from argparse import ArgumentParser
import mmap
from struct import pack, unpack


def main():
    parser = ArgumentParser()
    parser.add_argument('file')
    args = parser.parse_args()

    file = open(args.file, 'rb')
    data = mmap.mmap(file.fileno(), 0, access=mmap.ACCESS_READ)

    and_ac_andro_offset = data.find(pack('<I', 0x41414141))
    aes_key = data[and_ac_andro_offset+4:and_ac_andro_offset+4+32]

    print('aes key = ', aes_key)


if __name__ == '__main__':
    main()
